/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 841756
 */
@Entity
@Table(name = "tblconceptoagrupacion")
@NamedQueries({
    @NamedQuery(name = "Tblconceptoagrupacion.findAll", query = "SELECT t FROM Tblconceptoagrupacion t"),
    @NamedQuery(name = "Tblconceptoagrupacion.findByAgrupacion", query = "SELECT t FROM Tblconceptoagrupacion t WHERE t.agrupacion = :agrupacion"),
    @NamedQuery(name = "Tblconceptoagrupacion.findByConceptoAgrupacion", query = "SELECT t FROM Tblconceptoagrupacion t WHERE t.conceptoAgrupacion = :conceptoAgrupacion"),
    @NamedQuery(name = "Tblconceptoagrupacion.findByFormula", query = "SELECT t FROM Tblconceptoagrupacion t WHERE t.formula = :formula")})
public class Tblconceptoagrupacion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "agrupacion")
    private String agrupacion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "concepto_agrupacion")
    private String conceptoAgrupacion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "formula")
    private String formula;
    @JoinColumn(name = "cod_compania", referencedColumnName = "cod_compania")
    @ManyToOne(optional = false)
    private Tblcompania codCompania;
    @JoinColumn(name = "id_estado", referencedColumnName = "id_estado")
    @ManyToOne(optional = false)
    private TblEstado idEstado;

    public Tblconceptoagrupacion() {
    }

    public Tblconceptoagrupacion(String agrupacion) {
        this.agrupacion = agrupacion;
    }

    public Tblconceptoagrupacion(String agrupacion, String conceptoAgrupacion, String formula) {
        this.agrupacion = agrupacion;
        this.conceptoAgrupacion = conceptoAgrupacion;
        this.formula = formula;
    }

    public String getAgrupacion() {
        return agrupacion;
    }

    public void setAgrupacion(String agrupacion) {
        this.agrupacion = agrupacion;
    }

    public String getConceptoAgrupacion() {
        return conceptoAgrupacion;
    }

    public void setConceptoAgrupacion(String conceptoAgrupacion) {
        this.conceptoAgrupacion = conceptoAgrupacion;
    }

    public String getFormula() {
        return formula;
    }

    public void setFormula(String formula) {
        this.formula = formula;
    }

    public Tblcompania getCodCompania() {
        return codCompania;
    }

    public void setCodCompania(Tblcompania codCompania) {
        this.codCompania = codCompania;
    }

    public TblEstado getIdEstado() {
        return idEstado;
    }

    public void setIdEstado(TblEstado idEstado) {
        this.idEstado = idEstado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (agrupacion != null ? agrupacion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tblconceptoagrupacion)) {
            return false;
        }
        Tblconceptoagrupacion other = (Tblconceptoagrupacion) object;
        if ((this.agrupacion == null && other.agrupacion != null) || (this.agrupacion != null && !this.agrupacion.equals(other.agrupacion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "" + conceptoAgrupacion + "";
    }
    
}
